<template>
	<view>
		<u-overlay :show="show">
			<view class="warp">
				<view class="rect">
					<!-- <view class="text" v-if="textFlag == false">{{text}}</view> -->
					<view class="input">
						<u--textarea v-model="textareaValue" :placeholder="placeholder"></u--textarea>
					</view>
					<view class="btn">
						<view class="cencle" @click="popCancel">取消</view>
						<view class="sure" @click="popSure">确认</view>
					</view>
				</view>
			</view>
		</u-overlay>
	</view>
</template>

<script>
	export default {
		name: 'base-pop',
		props: {
			// 显示或者隐藏
			show: {
				type: Boolean,
				default: false
			},
			// 展示文本
			text: {
				type: String,
				default: ''
			},
			placeholder:{
				type: String,
				default: ''
			}
		},
		data() {
			return {
				textareaValue: ''
			}
		},
		methods: {
			// 确定
			popSure() {
					let val = this.textareaValue
					this.$emit('backSure', val)
					this.textareaValue = ''
			},
			// 取消
			popCancel() {
					this.$emit('cancelBtn')
					this.textareaValue = ''
			}
		}

	}
</script>

<style>
	.warp {
		display: flex;
		align-items: center;
		justify-content: center;
		margin-top: 200rpx;
		height: 100%;
	}

	.rect {
		width: 70%;
		border-radius: 20rpx;
		background-color: #fff;
		padding: 30rpx 0;
		box-sizing: border-box;
		color: #65717D;
		font-size: 32rpx;
	}

	.text {
		padding: 20rpx 30rpx;
	}

	.input {
		padding: 0 40rpx;
		border-radius: 20rpx;
	}

	.btn {
		display: flex;
		padding: 40rpx 40rpx 0 40rpx;
		box-sizing: border-box;
	}

	.cencle {
		width: 50%;
		height: 70rpx;
		line-height: 70rpx;
		background-color: #F5F5F5;
		color: #65717D;
		margin-right: 36rpx;
		border-radius: 14rpx;
		text-align: center;
	}

	.sure {
		width: 50%;
		height: 70rpx;
		line-height: 70rpx;
		background-color: #3473F9;
		color: #FFFFFF;
		border-radius: 14rpx;
		text-align: center;
	}

	>>>.u-textarea {
		background-color: #F5F6F9;
		margin-top: 20rpx;
	}
</style>
